package com.cxria.pattern.memento.func1

class Originator2{

    String state = ''

    Memento createMemento(){
        new Memento(state)
    }

    void restoreMemento(Memento memento){
        setState(memento.state)
    }

}